<?php

function isLogin() {
    if(isset($_SESSION['login'])){
       return $_SESSION['login'] == true;   
    }
    return false;
}

function isAdmin() {
    if (isLogin()) {
        return $_SESSION['admin'] == '1';
    }
    return false;
}

function fetch_multi_assoc($resultSet, $singleResult = 0) {

    $result = array();
    $field = array();
    
    while ($row = mysql_fetch_assoc($resultSet)) {
        array_push($result, $row);
    }
    
    mysql_free_result($resultSet);
    
    return($result);
}

?>
